package com.lvhaosb.newpneumonia.web.controller;


import com.lvhaosb.newpneumonia.POJO.vo.DomesticCityEpidemicInfo;
import com.lvhaosb.newpneumonia.POJO.vo.Result;
import com.lvhaosb.newpneumonia.service.DomesticCityEpidemicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 国内各大新冠疫情 前端控制器
 *
 * @author lvhao
 * @since 2020-06-21
 */
@CrossOrigin
@RestController
@RequestMapping("/domestic_city_epidemic")
public class DomesticCityEpidemicController {
    @Autowired
    private DomesticCityEpidemicService domesticCityEpidemicService;

    @GetMapping("/new_info")
    public Result getNewInfo(){
        List<DomesticCityEpidemicInfo> domesticCityEpidemicInfos = domesticCityEpidemicService.queryDomesticCityEpidemicInfo();
        return new Result(200,"请求成功",domesticCityEpidemicInfos);
    }

}

